package com.centaur0.dwr;

import javax.servlet.RequestDispatcher;

import uk.ltd.getahead.dwr.WebContext;

import com.centaur0.util.Application;

public class SiteEngine {
	public String getHTMLContent(String url){
		DWRHttpServletResponse response;
		try{
			WebContext dwrContext = Application.getResource("dwrContext");
			RequestDispatcher dispatcher = dwrContext.getServletContext().getRequestDispatcher(url);
			response = new DWRHttpServletResponse(dwrContext.getHttpServletResponse());
			dispatcher.include(dwrContext.getHttpServletRequest(), response);
		} catch(Exception e){
			return e.getLocalizedMessage();
		}
		return response.toString();
	}
}
